/*
 * Copyright (c) 2018-2999 湖南洛云网络科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 */

package com.yami.shop.seckill.comment.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.seckill.comment.model.SeckillSku;

import java.util.List;

/**
 * 秒杀活动sku
 *
 * @author LGH
 * @date 2019-08-28 09:36:59
 */
public interface SeckillSkuService extends IService<SeckillSku> {

    /**
     * 获取某个活动的秒杀sku列表
     * @param seckillId
     * @return
     */
    List<SeckillSku> listSeckillSkuBySeckillId(Long seckillId);

    /**
     * 删除秒杀活动商品的缓存
     * @param seckillId
     */
    void removeSeckillSkuCacheBySeckillId(Long seckillId);

    /**
     * 获取秒杀商品
     * @param seckillSkuId
     * @return
     */
    SeckillSku getSeckillSkuById(Long seckillSkuId);

    /**
     * 删除缓存
     * @param seckillSkuId
     * @param seckillId
     */
    void removeSeckillCacheSkuById(Long seckillSkuId,Long seckillId);

    /**
     * 获取秒杀商品sku
     * @param skuId
     * @param orderNumber
     * @return
     */
    SeckillSku getSeckillSkuBySkuIdAndOrderNumber(Long skuId, String orderNumber);

    /**
     * 加库存
     * @param seckillSkuId
     * @param prodCount
     */
    void addInventory(Long seckillSkuId, Integer prodCount);
}
